//
// Created by admin on 2021/10/24.
// @author 梦小星
//

#ifndef LEARNDATASTRUCTURE_SQLIST_H
#define LEARNDATASTRUCTURE_SQLIST_H
#define MAX_SIZE 20
typedef int ElemType;
//定义顺序表的结构体
typedef struct {
    ElemType data[MAX_SIZE];
    int length;
} SqList;
void initList(SqList &list);
int length(SqList list);
int locateElem(SqList list,ElemType e);
ElemType getElem(SqList list,int position);
void listInsert(SqList &list, int position,ElemType e);
void listDelete(SqList &list, int position,ElemType &e);
void printList(SqList list);
void destroyList(SqList &list);
bool isListEmpty(SqList list);
#endif //LEARNDATASTRUCTURE_SQLIST_H
